#include "Material.h"
#include "File.h"
#include "Shader.h"
#include "Texture2D.h"

Material::Material(Context* context) :Resource(context)
{
	/*Pass pass;
	pass.passIdx = (unsigned)RenderPass::PreZPass;
	pass.programState = context_->GetShaderCache()->Create("Shaders/PreZ.glsl", { });
	this->AddPass(pass);*/
}

Material::~Material()
{
	for (auto& itr : pass_)
	{
		itr.Release();
	}
}

bool Material::BeginLoad(File & source)
{
	SetName(source.GetName());
	source.Open();
	source.Seek(0);
	unsigned dataSize = source.GetSize();

	std::string context;
	context.resize(dataSize + 1);
	return true;
}

bool Material::EndLoad()
{
	return true;
}

void Material::AddPass(const Pass & pass)
{
	pass_.push_back(pass);
}

void Pass::Release()
{
	
}
